program poluprohodnoi_ball;
var F:array[0..300] of integer;
    names:array[1..500] of string[50];
    res:array[1..500] of integer;
    x,y,z:integer;
    i,j,n,k:integer;
    b:integer;
    c:char;
    empty:string[49];
begin
write('>> enter N: ');
readln(n);
write('>> enter K: ');
readln(k);

for i:=1 to n do begin
	repeat
		read(c);
		if c<>' ' then names[i]:=names[i]+c;
	until c=' ';
	readln(x,y,z);
	inc( F[x+y+z] );
	res[i]:=x+y+z;
	end;
i:=0; j:=301;
while (i <= k) and (j >= 0) do begin
	dec(j);
	i:=i+F[j];
	end;
writeln('===== resutls =====');
writeln(j:9);
for i:=1 to n do begin
	if (res[i] >= j) then begin
		{uber interactivity}
		empty:=' ';
		for x:=(50 - length(names[i])) downto 2 do empty:=empty+'.';
		empty:=empty+' ';

		writeln(names[i],empty,res[i]);
		end;
	end;
readln;
end.
